package com.sll.hosptials.vo;

import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("通用返回类")
public class Result<T> {

    private int code;
    private String msg;
    private T data;

    public static Result<?> success(){
        return new Result(0,"成功",null);
    }

    public static <T> Result<T> success(T data){
        return new Result(0,"成功",data);
    }

    public static  Result<String> serviceError(String massage){
        return new Result(1,massage,null);
    }

}
